feat: Implemented Bootstrap module in py-libp2p#711
Conversation
|
@sumanjeet0012 : Huge thanks for this fantastic contribution! 🙌 Very much appreciate the effort you've put into implementing the Bootstrap module — this fills a critical gap in Also, thank you for taking the time to rebase the branch — once checked in, any remaining merge conflict issues can be resolved right away. Looking forward to reviewing the PR in detail soon — and let us know if you need any help there. |
5af1ff6 to
ddbd190
Compare
.gitignore
Outdated
| bootstrap_instructions.txt | ||
| .gitignore | ||
| README.md |
There was a problem hiding this comment.
What are these about? If a bootstrap_instructions.txt is being generated somewhere, we should delete it rather than ignoring it.
I don't think we'd ever want to ignore a .gitignore or README.md file
There was a problem hiding this comment.
@pacrob The .gitignore file was pushed accidentally.
I was trying to create documentations using AI and accidently pushed it.
|
@pacrob I noticed that in js-libp2p, they include bootstrap node addresses such as Should I have checked the py-multiaddr repository and noticed that support for resolving DNS addresses has been recently added. However, I am unsure how to utilize this functionality within py-libp2p, as the resolve method does not currently appear to be available on the Multiaddress object. |
|
@sumanjeet0012 :Great question — and really appreciate you digging into how You're also spot-on about recent progress — the Right now, as you noticed, the
If you’re interested, we will be happy to help sketch out a small utility function to prototype this. Once we have that working, we could open a discussion or PR to integrate it more fully into the connection logic. Really excited to see you exploring this — it’s exactly the kind of cross-impl insight that strengthens the ecosystem. Let’s definitely move this forward! |
|
@sumanjeet0012 : Wish if you could add this to a new discussion page on bootstrap module. Me, @acul71 and @pacrob will discuss with you on py-multiaddrs there. Wish to keep the PR easy to navigate for new developers interested in contributing or extending your nice work on bootstrap module in py-libp2p. |
Hello @seetadev @sumanjeet0012 See here: |
@acul71 : Great, thank you so much for sharing. This is indeed very helpful. |
|
@acul71 Could you please try running the DNS resolution in py-libp2p using any example file? |
Since we don't still have access to py-multiaddr PyPi we have to find a way to use py-multiaddr not using dependency management via the standard PyPI mechanism (specifying the version in your project’s pyproject.toml or requirements.txt) requires an actual release.
|
|
@sumanjeet0012 Py-libp2p Multihash Compatibility Fix #751 |
…py-libp2p into feature/bootstrap
|
@sumanjeet0012 ERROR tests/core/crypto/test_ed25519.py - AttributeError: module 'multihash' ...
ERROR tests/core/crypto/test_rsa.py - AttributeError: module 'multihash' has ...
ERROR tests/core/crypto/test_ed25519.py - AttributeError: module 'multihash' ...
ERROR tests/core/crypto/test_rsa.py - AttributeError: module 'multihash' has ...
ERROR tests/core/crypto/test_secp256k1.py - AttributeError: module 'multihash...
ERROR tests/core/crypto/test_secp256k1.py - AttributeError: module 'multihash...
ERROR tests/core/examples/test_examples.py - AttributeError: module 'multihas...
ERROR tests/core/examples/test_examples.py - AttributeError: module 'multihas...should be caused by the new Do you have errors locally? |
@acul71 I have applied the patch locally and two tests were failing locally I will try to fix them. |
|
@sumanjeet0012 and @acul71 : Nice collaboration and great efforts indeed. Appreciate the continued momentum. Reviewing the PR in parallel as key changes are added. |
…py-libp2p into feature/bootstrap
|
@sumanjeet0012 : Wish to share that there are some merge conflicts coming up, which need to be resolved. Seems like due to recent merge of PR: #766 (we updated py-multiaddrs). CCing @acul71 . |
|
@seetadev Resolved merge conflicts. |
|
@sumanjeet0012 : Appreciate your great work. Can you please share a small screencast or demo with bootstrap module? Kindly also include the updated developer docs at the discussion page. This is indeed a very important PR. CCing @pacrob and @acul71: Hi Paul and Luca. Wish to have your feedback, pointers and review on this important PR, which enable us to use bootstrap module in py-libp2p. |
|
@seetadev I have created a demo video demonstrating how bootstrap module is working in py-libp2p. |
|
@sumanjeet0012 : Great, thank you Sumanjeet. This looks ready for final review + merge. CCing @acul71, @lla-dane , @guha-rahul for a final feedback points. |
|
@sumanjeet0012 : Reviewed the PR. Bootstrap module is indeed working fine. We will have some more improvements and integrations coming along soon. Doing a final review and merge. Appreciate your efforts and initiative. Also, wish to thank @acul71 for his efforts and support. |
What was wrong?
Bootstrap Module was not present in py-libp2p.
The py-libp2p library lacked a bootstrap discovery mechanism, which is essential for nodes to connect to predefined bootstrap peers when joining a network.
Issue #607
How was it fixed?
Implemented Bootstrap module in py-libp2p with the following key components:
1. Core Module Implementation
libp2p/discovery/bootstrap/directory with:bootstrap.py: MainBootstrapDiscoveryclass that processes bootstrap peer addressesutils.py: Address validation and peer info parsing utilities__init__.py: Module exports2. Host Integration
bootstrapparameter tonew_host()function inlibp2p/__init__.pyBasicHostandRoutedHostclasses to support bootstrap discovery3. Key Features
PeerInfoobjects4. Examples and Tests
examples/bootstrap/bootstrap.pywith CLI interfaceTo-Do
Cute Animal Picture